<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <!-- MOTW-DISABLED saved from url=(0014)about:internet -->
    <title>Display the result</title>
    <link rel="StyleSheet" href="css/ScriptingWithJavaScript.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="css/webworks.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="webworks.css" type="text/css" media="all" />
    <script type="text/javascript" language="JavaScript1.2">
      <!--
        var  WebWorksRootPath = "";
      // -->
    </script>
  </head>
  <body>
    <div style="text-align: left;">
      <table cellspacing="0" summary="">
        <tr>
          <td>
            <a href="ScriptingWithJavaScript.22.09.html"><img src="images/prev.gif" alt="Previous" border="0" /></a>
          </td>
          <td>
            <a href="ScriptingWithJavaScript.22.11.html"><img src="images/next.gif" alt="Next" border="0" /></a>
          </td>
        </tr>
      </table>
    </div>
    <hr align="left" />
    <blockquote>
      <h3 class="N_TutorialTask">Task 4:&nbsp;&nbsp;<a name="151847">Display the result</a></h3>
      <p class="b_Body"><a name="151848">To display the count of customers with the string Mini in their names, insert code in a method that runs after the processing of all the rows in the list. One logical place for this code is in the ReportDesign.afterFactorymethod. </a></p>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732pt; white-space: nowrap">
                <span class="zAuto_0023Format">1&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="151852">In Outline, select the report design, as shown in </a><a href="#152893" title="Display the result">Figure&nbsp;22-9</a>.</div>
            </td>
          </tr>
        </table>
      </div>
      <p class="i2_Image2"><a name="151861"><img class="Default" src="images/tutorial3Shot5A.png" style="display: inline; float: none; left: 0.0; top: 0.0" alt="Figure 23-9 Selecting the report design in Outline" /></a></p>
      <div class="fc2_FigCall2Title">
        <b class="Bold">Figure&nbsp;22-9&nbsp;&nbsp;</b><a name="152893">Selecting the report design in Outline</a></div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732pt; white-space: nowrap">
                <span class="zAuto_0023Format">2&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="151863">Select the afterFactory method from the list of available scripts in the script editor.</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732pt; white-space: nowrap">
                <span class="zAuto_0023Format">3&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="151864">Type the following code into the afterFactory method:</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="cfi_CodeFirstIndent"><a name="177318">importPackage(&nbsp;Packages.javax.swing&nbsp;);</a></div>
      <div class="coi_CodeIndent"><a name="177319">frame = new JFrame(&nbsp;"Count of Minis = " + countOfMinis&nbsp;);</a></div>
      <div class="coi_CodeIndent"><a name="177320">frame.setBounds(&nbsp;310, 220, 300, 20&nbsp;);</a></div>
      <div class="coi_CodeIndent"><a name="151868">frame.show(&nbsp;);</a></div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732pt; white-space: nowrap">
                <span class="zAuto_0023Format">4&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="151869">Select Preview to see the results. If there are no errors in the code, you see a report similar to the one in </a><a href="#152907" title="Display the result">Figure&nbsp;22-10</a>.</div>
            </td>
          </tr>
        </table>
      </div>
      <p class="i2_Image2"><a name="151881"><img class="Default" src="images/tutorial3Shot6.png" style="display: inline; float: none; left: 0.0; top: 0.0" alt="Figure 22-10 Result of changing the afterFactory( ) method" /></a></p>
      <div class="fc2_FigCall2Title">
        <b class="Bold">Figure&nbsp;22-10&nbsp;&nbsp;</b><a name="152907">Result of changing the afterFactory(&nbsp;) method</a></div>
      <p class="b_Body"><a name="151883">If you do not see the Count of Minis window, look for it behind the Eclipse window. If the Count of Minis window does not appear, the most likely reason is a scripting error caused by an error in one of your code entries. </a></p>
      <p class="b_Body"><a name="151884">If you suspect that a scripting error occurred, scroll to the bottom of the report where all scripting error messages appear. In most situations, there is a brief error message next to a plus sign (&nbsp;+&nbsp;). The plus sign indicates that there is a more detailed error message that is only visible after you expand the brief error message. To expand the brief error message, choose the plus sign. Scroll down to see the more detailed error message.</a></p>
    </blockquote>
    <hr align="left" />
    <table align="right" summary="">
      <tr>
        <td class="WebWorks_Company_Name_Bottom">
          <a href="notices.html">(c) Copyright Actuate Corporation 2013</a>
        </td>
      </tr>
    </table>
  </body>
</html>